<template>
  <div id="nav">
    <div class="nav">
      <a href="" :class="$route.query.cid ? 'ib' : 'cur ib'">首页</a>

      <!-- <a  class="ib"  v-bind:href="path + '/moreuestion?cid='+item.CategoryId+'&kw='+kw"    target="_blank"   v-for="(item,index) in navigationlist" :key="index">{{item.Title}}</a> -->

      <router-link
        @click.native="childMethod()"
        :class="$route.query.cid == item.CategoryId ? 'cur ib' : 'ib'"
        :to="{ path: 'MoreQuestion', query: { cid: item.CategoryId, kw: kw } }"
        v-for="(item, index) in navigationlist"
        :key="index"
        >{{ item.Title }}</router-link
      >
    </div>
  </div>
</template>
<script>
import { GetNavigation } from "@/api/faq";
export default {
  name: "Navigation",
  data() {
    return {
      navigationlist: [],
      path: "",
      kw: "",
      id: this.$route.query.cid,
    };
  },

  mounted() {
    this.GetNavigation();
  },
  methods: {
    childMethod() {    
      this.$emit("searchnavi");
    },
    onSubmit() {
      this.$message("submit!");
    },
    onCancel() {
      this.$message({
        message: "cancel!",
        type: "warning",
      });
    },

    async GetNavigation() {
      var data = await GetNavigation();
      this.navigationlist = data;
      console.log(this.navigationlist);
    },
  },
};
</script>

<style scoped>
</style>

